﻿//INNOVACALL FRAMEWORK MUST BE IN ALL VIEW JAVASCRIPT
$.fn.DocReady = function () {
	$.fn.PrepareLayoutMenus();
	$.fn.TabifyCodeFiles();
	//Add call to execute when document is ready
	$("#chkDisplayText").bind("click", $.fn.ToggleDisplayText);
}

$.fn.MainAjaxSuccess = function (a, b, c) {
	var redirect = null;
	if (a.success) redirect = "/";
	$.fn.jqDialogAlert(a.messageTitle, a.message, redirect);
}

$.fn.ToggleDisplayText = function () {
	var currentType = $('#pwdOldPassword').get(0).type;
	if (currentType == "password") {
		$('#pwdOldPassword').get(0).type = "text";
		$('#pwdNewPassword').get(0).type = "text";
		$('#pwdRetypePassword').get(0).type = "text";
	} else {
		$('#pwdOldPassword').get(0).type = "password";
		$('#pwdNewPassword').get(0).type = "password";
		$('#pwdRetypePassword').get(0).type = "password";
	}
}
